<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2021/9/11
  Time: 13:30
  To change this template use File | Settings | File Templates.
--%>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
            + path + "/";
%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<html>
<head>
    <base href="<%=basePath%>"/>
    <title>用户列表</title>


    <%-- 分页相关 --%>
    <script type="text/javascript" src="<%=basePath%>static/js/jquery.js"></script>
    <script type="text/javascript" src="<%=basePath%>static/js/kkpager/jpager.js"></script>
    <link rel="stylesheet" type="text/css"
          href="<%=basePath%>static/js/kkpager/jpager.css">
    <script type="text/javascript" src="<%=basePath%>view/page/listPage.js"></script>
    <script type="text/javascript">
        function load() {
            arrayPage(${pageResult.pages},${pageResult.total});
        }




    </script>


</head>
<body onload="load()">
<center>
    <h1>用户列表</h1>
    <a href="<%=basePath%>view/system/user/addUser.jsp">增加</a>
    <hr>
    <table width="80%" border="1">
        <tr>
            <td>ID</td>
            <td>姓名</td>
            <td>性别</td>
            <td>地址</td>
            <td>登录名</td>
            <td>密码</td>
            <td>状态</td>
            <td>描述</td>
            <td colspan="2">操作</td>
        </tr>
<%--        <c:forEach items="${user_dbList}" var="user">--%>
        <c:forEach items="${pageResult.dataList}" var="user">
            <tr>
                <td>${user.userId}</td>
                <td>${user.name}</td>
                <td>${user.sex}</td>
                <td>${user.address}</td>
                <td>${user.username}</td>
                <td>${user.password}</td>
                <td>${user.state}</td>
                <td>${user.description}</td>
                <shiro:hasPermission name="user:delete">
                <td><a href="<%=basePath%>userController/delete.do?userIdStr=${user.userId}">删除</a></td>
                </shiro:hasPermission>

                <shiro:hasPermission name="user:updaeUI">
                <td><a href="<%=basePath%>userController/updateUI.do?userIdStr=${user.userId}">修改</a></td>
                </shiro:hasPermission>

                <shiro:hasRole name="sys:GLY">
                <td><a href="<%=basePath%>roleController/FPRoleUI.do?userIdStr=${user.userId}">分配角色</a></td>
                </shiro:hasRole>

            </tr>
        </c:forEach>
    </table>
    <center>
        <div id="jpager"></div>
    </center>

</center>
</body>
</html>
